package com.homegoods.discover.presenter;

import com.homegoods.discover.model.MessageTipModel;
import com.kedll.library.mvp.AbstractRefreshPresenter;
import com.kedll.library.mvp.RefreshingView;

import io.reactivex.Observable;

/**
 * @author QiQi
 * @ClassName: ActivityPresenter
 * @date 2018/10/3
 * @description
 */
public class MessageTipPresenter extends AbstractRefreshPresenter {
    public MessageTipPresenter(RefreshingView mView) {
        super(mView);
    }

    @Override
    protected void fetchData(boolean isLoadMore) {

        addSubscription(Observable.range(0, 10)
                .map(integer -> {
                    MessageTipModel model = new MessageTipModel();
                    model.setDate("2018-10-03");
                    model.setTitle("您的充值返金币已到账");
                    model.setId("" + page * PER_PAGE_COUNT + integer);
                    return model;
                })
                .toList()
                .subscribe(activityModels -> parserData(isLoadMore, activityModels))
        );

    }
}
